package com.yanqu.road.entity.activity.entername;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_n_activity_group_match")
public class ActivityGroupMatch extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "分组id", update = true)
    private int groupId;

    @FieldTypeAnnotation(desc = "对手分组id")
    private int enemyGroupId;

    @FieldTypeAnnotation(desc = "分组包含区域id")
    private List<Integer> zoneIdList = new ArrayList<>();

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if(this.groupId != groupId) {
            this.groupId = groupId;
            setUpdateOption();
        }
    }

    public int getEnemyGroupId() {
        return enemyGroupId;
    }

    public void setEnemyGroupId(int enemyGroupId) {
        if(this.enemyGroupId != enemyGroupId) {
            this.enemyGroupId = enemyGroupId;
            setUpdateOption();
        }
    }

    public List<Integer> getZoneIdList() {
        return zoneIdList;
    }

    public void setZoneIdList(List<Integer> zoneIdList) {
        this.zoneIdList = zoneIdList;
        setUpdateOption();
    }

    /**
     * 获取对阵榜单key
     */
    public int getRankMatchGroupId(){
        if(groupId < enemyGroupId){
            return groupId * 10000 + enemyGroupId;
        }
        return enemyGroupId * 10000 + groupId;
    }
}
